import request from '@/utils/request'

const pre = '/fmea/common/controlPlan'

// 获取控制计划
export function getPlanlist(query) {
  return request({
    url: `${pre}/getPlanlist`,
    method: 'get',
    params: query
  })
}

// 获取控制计划详情
export function getPlanDetail(id) {
  return request({
    url: `${pre}/getProjectId/${id}`,
    method: 'get'
  })
}

// 获取控制计划表格
export function getPlanTable(query) {
  return request({
    url: `/fmea/common/controlPlanGrid/list`,
    method: 'get',
    params: query
  })
}

// 修改控制计划详情
export function editPlan(data) {
  return request({
    url: '/fmea/common/controlPlan',
    method: 'put',
    data: data
  })
}

// 导出控制计划
export function exportControlPlan(query) {
  return request({
    url: '/fmea/common/controlPlanGrid/export',
    method: 'get',
    params: query
  })
}
